<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>vue的基本代码</title>
</head>
<body>

<div id="app">
</div>
<div id="app1">
    <p>{{ fullName }}</p>
</div>


<script src="lib/vue-2.4.0.js"></script>
<script>

    var vue = new Vue({
        el: '#app',
        data: {
            firstName: '赵',
            lastName: '思'
        },
        computed: {
            fullName () {
                return this.firstName + ' ' + this.lastName
            }
        }
    })

    // 计算属性还可以依赖其他实列中的值
    var vue1 = new Vue({
        el: '#app1',
        data: {

        },
        computed: {
            fullName () {
                return vue.firstName + ' ' + vue.lastName
            }
        }
    })

</script>
</body>
</html>